home *** CD-ROM | disk | FTP | other *** search
- /* $VER: 0.4 19-04-94 */
- /* (1994) Krzysztof P. Jasiutowicz. GetAutoDocs Arexx macro for GoldED */
- /* Requirements!!! */
- /* 1. GetAutodocs - part of DevKit available on Fish disks */
- /* 2. AutoDocs: assign - where AutoDocs reside */
- /* 3. Arexx */
- /* Adapted from ©1989 Peter Cherna CED<->rexx script Lookup.ced */
-
- OPTIONS RESULTS /* enable return codes */
-
- if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
- address 'GOLDED.1'
-
- 'LOCK CURRENT' /* lock GUI, gain access */
- OPTIONS FAILAT 6 /* ignore warnings */
- SIGNAL ON SYNTAX /* ensure clean exit */
-
-
- /* get word under cursor */
- 'QUERY WORD VAR FUNC'
- startpos=pos('=', FUNC )+1
-
- FUNC=substr(FUNC,startpos)
-
- /* status bar message */
- 'REQUEST STATUS="Searching for autodoc ..."'
-
- /* build filename */
- filename = 'T:' || FUNC || '.autodoc'
-
- /* calling GetAutoDoc by © 1989 Peter Cherna */
- address command 'GetAutoDoc >' || filename || ' ' || FUNC
-
- /* can't find resulting autodoc entry */
- if open('autodocfile',filename) = 0 then
- DO
- 'REQUEST BODY="GetAutoDoc failed !"'
- 'UNLOCK'
- exit
- END
- /* main processing */
- else
- DO
- line = readln('autodocfile')
- call close 'autodocfile'
- if left(line,1) = '-' then
- DO
- address command 'delete >NIL:' filename
- 'REQUEST BODY="'FUNC' definition not found"'
- UNLOCK
- exit
- END
- ELSE
- DO
-
- 'QUERY WINDOWS VAR NUMWINS'
-
- /* get the name of the adoc file */
- adocfile= getclip('adocwindow')
-
- /* get the name of the file in the current window */
- 'QUERY FILE '
-
- /* we're in the helpwindow itself*/
- if RESULT~=adocfile THEN
- DO
- /* cycle through */
- DO NUMWINS=NUMWINS TO 1 BY -1 until RESULT = adocfile
-
- 'WINDOW NEXT'
- 'QUERY FILE'
- END
- END
- /* if we haven't got a helpwindow */
- if RESULT~=adocfile then
- DO
- 'MORE'
- END
- END
-
- 'OPEN NAME 'filename' QUIET'
- 'QUERY FILE'
- call setclip 'adocwindow',RESULT
-
- /* delete left-overs */
- address command 'delete >NIL:' filename
-
- 'UNLOCK' /* VERY important: unlock GUI */
- EXIT
-
- SYNTAX:
-
- SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
- 'UNLOCK'
- EXIT
-